<?php
class NoBusinessBase_File_ReadAndReplace
{
   protected $_fileContent = "";

   public function __construct($path = null)
   {
      if($path != null)
         $this->readFile($path);
   }

   public function readFile($path)
   {
      $this->_fileContent = file_get_contents($path);
   }

   public function getContent($pairs = array())
   {
      $find = array();
      $replace = array();

      foreach($pairs as $key => $value)
      {
         $find[] = $key;
         $replace[] = $value;
      }

      return str_replace($find, $replace, $this->_fileContent);
   }
}

